package host.springboot.framework.context.mvc.converter;

import host.springboot.framework.core.constant.PatternConstant;
import org.jspecify.annotations.NonNull;
import org.springframework.core.convert.converter.Converter;

import java.time.MonthDay;

/**
 * {@code MonthDay} 自定义转换器
 *
 * @author JiYinchuan
 * @since 1.0.0
 */
public class MonthDayConverter implements Converter<String, MonthDay> {

    @Override
    public MonthDay convert(@NonNull String s) {
        return MonthDay.parse(s, PatternConstant.Date.NORM_MONTHDAY_FORMATTER);
    }
}
